<?php

	/*	
		START---------------------------------------------------------------------------------
	
		Name	: clsAction.php
		Version	: 1.0
		Author	: Henrik Andersen
		Company : Linnaeus University, Media Technology
		Mail	: Henrik.Andersen@lnu.se
		Date	: 2010-11-22 10:15 CET
		
		DESCRIPTION----------------------------------------------------------------------------
		
		This is an action object and is used to create events at certain hotspots (POI). 
		An action object can be assigned to clsLayar and clsHotspot.
	
		SYNTAX---------------------------------------------------------------------------------
		
		The following list contains the public functions that can be used externally.
		
		Method Name:													Short Description:
		
		* setAction("http://www.google.com", "The Google Webbpage")		Assign a action.		
		
		TO DO'S--------------------------------------------------------------------------------
		
		END------------------------------------------------------------------------------------
	*/
	
	// IMPORT
	
	require_once 'src/php/lib/QuickieLayar/Hotspot/clsTransform.php';
	require_once 'src/php/lib/QuickieLayar/Hotspot/clsObject.php';
	
	// PUBLIC CLASS
	
	class clsAction
	{				
		// PUBLIC CONSTANTS
		
		const GET					= "GET";
		const POST					= "POST";
		
		// PUBLIC VARIABELS
		
		/*	
			All the variables are mandatory and must obtain a 
			value for the system to function properly.
		*/
		
		public $uri					= null;
		public $label				= null;
		
		/* 
			following variables are optional and do not need 
			a value in order to make the system work properly.
		*/
		
		public $contentType			= null;
		public $method				= self::GET;
		public $params				= array();
		public $closeBiw			= false;
		public $activityType		= 0;
		public $showActivity		= true;
		public $activityMessage		= null;
		public $autoTriggerRange	= 0;
		public $autoTriggerOnly		= false;
						
		// CONSTRUCTOR FUNCTION
		
		/*------------------------------------------------------------------------------------
		__construct:									
		This is the constructor function and it creates instances of the necessary 
		external classes.
		------------------------------------------------------------------------------------*/
		public function __construct()
		{
			$this->transform = new clsTransform();
			$this->object 	 = new clsObject();
		}
		
		// PUBLIC FUNCTION
		
		/*------------------------------------------------------------------------------------
		setAction:									
		Public Function to assign this action item an action.
		
		!strURI			String		The URI to the action event.
		?strLabel		String		Assign this action with a lable.
		------------------------------------------------------------------------------------*/
		public function setAction($strURI, $strLabel = null)
		{
			$this->uri	 = $strURI;
			$this->label = $strLabel;
		}
		
		/*------------------------------------------------------------------------------------
		getAction:									
		Public Function to get information about this action.
		
		@return		Object		An object with information about this action.
		------------------------------------------------------------------------------------*/
		public function getAction()
		{
			$objAction			= new stdClass();
			$objAction->uri		= $this->uri;
			$objAction->label	= $this->label;
			
			return $objAction;
		}
	}

?>